﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace iot.Migrations
{
    public partial class init : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "devcie_point_infos",
                columns: table => new
                {
                    id = table.Column<string>(type: "TEXT", nullable: false),
                    device_id = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    point_name = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    point_address = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    ip = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
                    port = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
                    create_time = table.Column<DateTime>(type: "TEXT", nullable: true),
                    update_time = table.Column<DateTime>(type: "TEXT", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_devcie_point_infos", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "devices",
                columns: table => new
                {
                    id = table.Column<string>(type: "TEXT", nullable: false),
                    device_code = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    device_name = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    description = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
                    device_type = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
                    status = table.Column<string>(type: "TEXT", maxLength: 255, nullable: true),
                    img = table.Column<string>(type: "TEXT", maxLength: 255, nullable: false),
                    create_time = table.Column<DateTime>(type: "TEXT", nullable: false),
                    update_time = table.Column<DateTime>(type: "TEXT", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_devices", x => x.id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "devcie_point_infos");

            migrationBuilder.DropTable(
                name: "devices");
        }
    }
}
